package 递归;

import java.util.Scanner;

public class 汉诺塔 {

    // 初始a  目标c
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String a = scanner.next();
        String b = scanner.next();
        String c = scanner.next();
        solve(n,a,b,c);
    }
    static void solve(int n,String a,String b,String c){
        if (n==1){
            System.out.println(a+"===>"+c);
        }else {
            solve(n-1,a,c,b);
            System.out.println(a+"===>"+c);
            solve(n-1,b,a,c);
        }
    }
}
